package com.groupbuying.provider.controller;

import com.groupbuying.provider.service.StoreMainInfoAppService;
import com.groupbuying.provider.service.StoreShopAppService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Author: wenguoqiang
 * @Email wguoqiango@163.com
 * @Date: 2020/1/6 0006 下午 5:02
 * @Des
 */

@Api("门店接口")
@RestController
@RequestMapping("/app/shop")
public class StoreShopAppController {


        @Autowired
        private StoreShopAppService storeShopAppService;

        @Autowired
        private StoreMainInfoAppService storeMainInfoAppService;


        /**
         * @api {post} /app/shop/getShopList   获取商家列表
         * @apiExample
         * author wenguoqiang
         * tar 调用方：够样app
         * date 2020/1/7 0007 上午 9:42
         * @apiGroup
         * @apiVersion 1.0.0
         * @apiHeader {
         * @apiParam {String} null 无
         * @apiSuccess {Integer} code 请求结果 0-失败 1-成功
         * @apiSuccess {String} customerId 用户标示
         */
        @ApiOperation(value = "获取商家列表", notes = "获取商家列表")
        @GetMapping("/getShopList")
        public Object getShopList(@RequestParam Map<String, Object> params) {
            return storeShopAppService.getShopList(params);
        }

        /**
         * @api {post} /app/shop/getShopDetail  小程序获取门店详情
         * @apiExample
         * author wenguoqiang
         * tar 调用方：够样app
         * date 2020/1/7 0007 上午 11:46
         * @apiGroup
         * @apiVersion 1.0.0
         * @apiHeader {
         * @apiParam {String} null 无
         * @apiSuccess {Integer} code 请求结果 0-失败 1-成功
         * @apiSuccess {String} customerId 用户标示
         */
        @ApiOperation(value = "小程序获取门店详情", notes = "小程序获取门店详情")
        @GetMapping("/getShopDetail")
        public Object getShopDetail(@RequestParam Map<String, Object> params) {
            return storeMainInfoAppService.getShopDetail(params);
        }

        /**
         * @api {post} /app/shop/searchShopListByCategoryOrStoreName  通过分类或者商家名称获取商家列表
         * @apiExample
         * author wenguoqiang
         * tar 调用方：够样app
         * date 2020/1/7 0007 上午 11:47
         * @apiGroup
         * @apiVersion 1.0.0
         * @apiHeader {
         * @apiParam {String} null 无
         * @apiSuccess {Integer} code 请求结果 0-失败 1-成功
         * @apiSuccess {String} customerId 用户标示
         */
        @ApiOperation(value = "通过分类或者商家名称获取商家列表", notes = "通过分类获取商家列表")
        @GetMapping("/searchShopListByCategoryOrStoreName")
        public Object searchShopListByCategoryOrStoreName(@RequestParam Map<String, Object> params) {
            return storeShopAppService.searchShopListByCategoryOrStoreName(params);
        }

        /**
         * @api {post} /app/shop/getRecommendStoreList  获取推荐门店
         * @apiExample
         * author wenguoqiang
         * tar 调用方：够样app
         * date 2020/1/7 0007 上午 11:47
         * @apiGroup
         * @apiVersion 1.0.0
         * @apiHeader {
         * @apiParam {String} null 无
         * @apiSuccess {Integer} code 请求结果 0-失败 1-成功
         * @apiSuccess {String} customerId 用户标示
         */
        @ApiOperation(value = "获取推荐门店", notes = "获取推荐门店")
        @GetMapping("/getRecommendNearbyStoreList")
        public Object getRecommendNearbyStoreList(@RequestParam Map<String, Object> params) {
            return storeShopAppService.getRecommendNearbyStoreList(params);
        }


}

